<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
<link rel="stylesheet" href="__ROOT__/static/css/amazeui.min.css">
<script typet="text/javascript" src="__ROOT__/static/js/jquery-3.1.1.min.js"></script>
<script typet="text/javascript" src="__ROOT__/static/js/amazeui.min.js"></script>
</head>
<body>
<form class="am-form">
 <div class="am-form-group"><label for="doc-ipt-email-1">账号：</label>
	<input type="text" class="am-form-field user_no" name="" id="user_no" style="width: 30%"></div>
	<div class="am-form-group">
      <label for="doc-ipt-pwd-1">密码：</label>
      <input type="password" class="pwd" name="" id="password" style="width: 30%"></div>
      <input type="button" name="" value="登录" class="am-btn am-btn-primary login">
      <a href="{:url('login/register')}">注册账号</a>
</form>
</body>
<script type="text/javascript">
	$('.login').on('click',function(){
		//alert('a');
		var user_no = $('.user_no').val();
		var pwd = $('.pwd').val();
		$.ajax({
			url:"{:url('index/login/login_check')}",
			type:"post",
			dataType:"json",
			data:{
				'user_no':user_no,
				'password':pwd,
			},
			success:function(data){
				if(data.code=='0'){
					location.href = data.msg;
				}else{
					alert(data.msg);
				}
				
			}
		});
	});
</script>
</html>